<?php
/**
 * IG_Export
 *
 * @return IG_Export_Interface
 *
 * @author maomao.thx@gmail.com
 * @copyright Copyright (c) 2009 Green Shore (http://www.oaiwgame.com)
 * @version $Id: Export.php 1039 2011-11-15 02:28:21Z maomao.thx@gmail.com $
 */
Class IG_Export
{
    /**
     * 返回实例化的类,失败抛出异常
     * @param string $type
     * @return IG_Export_Excel
     */
    public static function factory($type)
    {
        $className = "IG_Export_".$type;
        if (class_exists($className))
            $class = new $className;

        if ($class instanceof IG_Export_Interface) {
            return $class;
        } else {
            throw new IG_Exception("Please check the type and class!");
        }
    }

}